<?php if (!defined('THINK_PATH')) exit();?><!--引入头部文件-->
<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>『寻梦』后台管理</title>
    <link rel="stylesheet" type="text/css" href="/blog/Public/Admin/css/common.css"/>
    <link rel="stylesheet" type="text/css" href="/blog/Public/Admin/css/main.css"/>
    <script type="text/javascript" src="/blog/Public/Admin/js/libs/modernizr.min.js"></script>
</head>
<body>
<div class="topbar-wrap white">
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <h1 class="topbar-logo none"><a href="index.html" class="navbar-brand">后台管理</a></h1>
            <ul class="navbar-list clearfix">
                <li><a class="on" href="<?php echo U('Index/index');?>">首页</a></li>
                <li><a href="<?php echo U('Index/show');?>" target="_blank">网站首页</a></li>
            </ul>
        </div>
        <div class="top-info-wrap">
            <ul class="top-info-list clearfix">
                <li><h1>当前登陆用户：<font color="red"><?php echo ($_COOKIE['username']); ?></font></h1></li>
                <li><a href="http://www.jscss.me">修改密码</a></li>
                <li><a href="<?php echo U('Login/ex');?>">退出</a></li>
            </ul>
        </div>
    </div>
</div>

<!--左侧导航-->
<div class="container clearfix">
    <div class="sidebar-wrap">
        <div class="sidebar-title">
            <h1>菜单</h1>
        </div>
        <div class="sidebar-content">
            <ul class="sidebar-list">
                <li>
                    <a href="<?php echo U('Design/design');?>"><i class="icon-font">&#xe003;</i>博文管理</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Design/dodesign');?>"><i class="icon-font">&#xe008;</i>添加博文</a></li>
                        <li><a href="<?php echo U('Design/design');?>"><i class="icon-font">&#xe008;</i>博文列表</a></li>
                    </ul>
                </li>
                <li>
                    <a href="<?php echo U('Zhangjie/design');?>"><i class="icon-font">&#xe003;</i>小说章节</a>
                    <ul class="sub-menu">
                        <!--<li><a href="<?php echo U('Zhangjie/dodesign');?>"><i class="icon-font">&#xe008;</i>添加章节</a></li>-->
                        <li><a href="<?php echo U('Zhangjie/design');?>"><i class="icon-font">&#xe008;</i>章节列表</a></li>
                    </ul>
                </li>
                <li>
                    <a href="<?php echo U('Insert/insert');?>"><i class="icon-font">&#xe003;</i>分类管理</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Insert/doinsert');?>"><i class="icon-font">&#xe008;</i>分类添加</a></li>
                        <li><a href="<?php echo U('Insert/insert');?>"><i class="icon-font">&#xe008;</i>分类列表</a></li>
                    </ul>
                </li>
                <li>
                    <a href="<?php echo U('Tag/tag');?>"><i class="icon-font">&#xe003;</i>标签管理</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Tag/dotag');?>"><i class="icon-font">&#xe008;</i>添加标签</a></li>
                        <li><a href="<?php echo U('Tag/tag');?>"><i class="icon-font">&#xe008;</i>标签列表</a></li>
                    </ul>
                </li>
                <li>
                    <a href="<?php echo U('Feedback/feedback');?>"><i class="icon-font">&#xe003;</i>留言管理</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Feedback/dofeedback');?>"><i class="icon-font">&#xe008;</i>查询未处理留言</a></li>
                        <li><a href="<?php echo U('Feedback/feedback');?>"><i class="icon-font">&#xe008;</i>查询已处理留言</a></li>
                    </ul>
                </li>
                <li>
                    <a href="<?php echo U('Fuqiang/show');?>"><i class="icon-font">&#xe003;</i>富强专属</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Fuqiang/fuqiang');?>"><i class="icon-font">&#xe008;</i>富强添加图片</a></li>
                        <li><a href="<?php echo U('Fuqiang/show');?>"><i class="icon-font">&#xe008;</i>富强数据库</a></li>
                    </ul>
                </li>
                <li>
                    <a href="<?php echo U('System/system');?>"><i class="icon-font">&#xe018;</i>系统管理</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('System/system');?>"><i class="icon-font">&#xe017;</i>系统设置</a></li>
                        <li><a href="<?php echo U('System/system');?>"><i class="icon-font">&#xe037;</i>清理缓存</a></li>
                        <li><a href="<?php echo U('System/system');?>"><i class="icon-font">&#xe046;</i>数据备份</a></li>
                        <li><a href="<?php echo U('System/system');?>"><i class="icon-font">&#xe045;</i>数据还原</a></li>
                    </ul>
                </li>
            </ul>
        </div>
    </div>
<style>
    .wrap{
        width: 260px;
        height: 80px;
        white-space: nowrap;
        text-overflow: ellipsis;
        overflow: hidden;
    }
</style>
    <!--/sidebar-->
    <div class="main-wrap">
        <div class="crumb-wrap">
            <div class="crumb-list"><i class="icon-font"></i><a href="/jscss/admin/design/">首页</a><span class="crumb-step">&gt;</span><a class="crumb-name" href="/jscss/admin/design/">博文管理</a><span class="crumb-step">&gt;</span><span>博文列表</span></div>
        </div>
        <div class="search-wrap">
            <div class="search-content">
                <form action="#" method="get" enctype="multipart/form-data">
                    <table class="search-tab">
                        <tr>
                            <th width="120">分类:</th>
                            <td>
                                <select name="search-sort" id="">
                                    <option value="">全部</option>
                                    <option value="19">WEB开发</option><option value="20">推荐界面</option>
                                </select>
                            </td>

                            <th width="70">标题:</th>
                            <td><input class="common-text" placeholder="关键字" name="keywords" value="<?php echo ($keywords); ?>" type="text" ></td>

                            <th width="70">标签:</th>
                            <td>
                                <select name="search-sort" id="">
                                    <option value="">全部</option>
                                    <option value="19">php</option><option value="20">mysql</option>
                                </select>
                            </td>
                            <td><input class="btn btn-primary btn2" name="sub" value="查询" type="submit"></td>
                        </tr>
                    </table>
                </form>
            </div>
        </div>
        <div class="result-wrap">
            <form name="myform" id="myform" method="post">
                <div class="result-title">
                    <div class="result-list">
                        <a href="<?php echo U('Insert/doinsert');?>"><i class="icon-font"></i>新增分类</a>
                        <a id="batchDel" href="javascript:void(0)"><i class="icon-font"></i>批量删除</a>
                        <a id="updateOrd" href="javascript:void(0)"><i class="icon-font"></i>更新排序</a>
                        <a href="javascript:void(0)" onclick="clickAll()">╋全选</a>
                        <a href="javascript:void(0)" onclick="notAll()">╬反选</a>
                    </div>
                </div>
                <div class="result-content">
                    <table class="result-tab" width="100%">
                        <tr>
                            <th class="tc" width="5%"><input class="allChoose" id="" name="" type="checkbox" onclick="all()"></th>
                            <th id="AAA">ID</th>
                            <th id="AAA">标题</th>
                            <th id="AAA">logo</th>
                            <th id="AAA">内容</th>
                            <th id="AAA">点击</th>
                            <th id="AAA">发布人</th>
                            <th id="AAA">更新时间</th>
                            <th id="AAA">评论</th>
                            <th id="AAA">操作</th>
                        </tr>
                        <?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$val): $mod = ($i % 2 );++$i;?><tr>
                            <td class="tc"><input type="checkbox" name="clickBox" value="<?php echo ($val["id"]); ?>"></td>
                            <td class="tc"><?php echo ($val["id"]); ?></td>
                            <td class="tc"><a href="<?php echo U('Design/lists');?>?id=<?php echo ($val["id"]); ?>"><?php echo ($val["title"]); ?></a></td>
                            <td class="tc"><img src="/blog/<?php echo ($val["img1"]); ?>" alt="1" width="50"></td>
                            <td class="tc" width="100" style="height: 80px"><div class="wrap"><?php echo ($val["uname"]); ?></div></td>
                            <td class="tc">
                                <button class="praise" id="<?php echo ($val["id"]); ?>">点赞</button>
                                <span id="num"><font color="blue">(<?php echo ($val["num"]); ?>)</font></span>
                            </td>
                            <td class="tc"><?php echo ($val["author"]); ?></td>
                            <td class="tc"><?php echo ($val["time"]); ?></td>+
                            <td class="tc"><a href="<?php echo U('Zhangjie/dodesign',array('t_id'=>$val['t_id']));?>">更新</a></td>
                            <td>
                                <a class="link-update" href="<?php echo U('Design/todesign');?>">修改</a>
                                <a class="link-del" href="<?php echo U('Design/delete',array('id'=>$val['id']));?>" onclick='if(!confirm("确认删除么?")){return false;}'>删除</a>
                            </td>
                        </tr><?php endforeach; endif; else: echo "" ;endif; ?>
                    </table>
                    <div class="list-page"><?php echo ($page); ?></div>
                </div>
            </form>
        </div>
    </div>
    <!--/main-->
</div>
</body>
<script>
//    //全选反选
//    $("input[name='all']").click(function(){
//        $("input[name='all2']").prop("checked",$("input[name='all']").prop("checkde"));
//    })

//全选
function clickAll() {
    var checkBox = document.getElementsByName('clickBox');
    if (checkBox[0].checked==true){
        for (i=0;i<checkBox.length;i++){
            checkBox[i].checked=false;
        }
        return;
    }
    for (i=0;i<checkBox.length;i++){
        checkBox[i].checked='checkde';
    }
}

//反选
function notAll() {
    var checkBox = document.getElementsByName('clickBox');
    for (i=0; i<checkBox.length;i++) {
        if (checkBox[i].checked== true) {
            checkBox[i].checked = false;
        }else{
            checkBox[i].checked = 'checkde';
        }
    }
}
</script>
<script src="/blog/Public/jquery.1.12.js"></script>
<script>
    $(".praise").click(function(){
        //alert(111);
        var id = $(this).attr('id');
        $.ajax({
            type:"post",
            url :"<?php echo U('Design/praise');?>",
            data:{id:id},
            success:function(msg){
                if(msg == 'no'){
                    num.innerHTML="<font color='red'>您已经点赞过啦！</font>"
                }else if(msg == 'error'){
                    num.innerHTML="<font color='red'>点赞失败！</font>"
                }else{
                    $("#num").html((msg));
                }
            }
        });
    })
</script>
</html>